//
//  UIButton+Extension.swift
//  zyqWeibo
//
//  Created by 张亚琼 on 15/7/2.
//  Copyright © 2015年 张亚琼. All rights reserved.
//

import UIKit
extension UIButton {
    
    convenience init(title:String,imageName:String,fontSize:CGFloat,titleColor:UIColor = UIColor.darkGrayColor()){
        self.init()
        setTitle(" " + title, forState: UIControlState.Normal)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
        setTitleColor(titleColor, forState: UIControlState.Normal)
    }
    
    convenience init(title:String,fontSize:CGFloat,backColor:UIColor = UIColor.brownColor(),titleColor:UIColor = UIColor.whiteColor()){
        self.init()
        setTitle(title, forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
        setTitleColor(titleColor, forState: UIControlState.Normal)
        backgroundColor = backColor
    }
}
